extends ../layouts/default

block intro
	.container
		h1 Gallery
	
block content
	.container
		if galleries.length
			each gallery in galleries
				h2= gallery.name
					if gallery.publishedDate
						.pull-right.text-muted= gallery._.publishedDate.format('Do MMM YYYY')
				
				.row.gallery-images
					if gallery.heroImage.exists
						.col-sm-4.col-md-4.gallery-image: img(src=gallery._.heroImage.limit(680,680)).img-rounded
						.col-sm-8.col-md-8: .row
							each image in gallery.images
								.col-xs-4.col-sm-4.col-md-3.gallery-image: img(src=image.limit(300,300)).img-rounded
					else
						each image in gallery.images
							.col-xs-6.col-sm-4.col-md-3.gallery-image: img(src=image.limit(300,300)).img-rounded
		else
			h3.text-muted There are no image galleries yet.
